@echo off
REM 安装组策略
@whoami /groups | find "S-1-16-12288" >nul 2>nul
@if ERRORLEVEL 1 (
	echo Permission invaild
	echo You should run this program as Administrator
	pause > nul
	exit
) else (
	pushd "%~dp0"
	echo.
	echo.
	echo -----------------------------------------------begin install-----------------------------------------------
	echo.
	dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
	dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
	for /f %%i in ('findstr /i . List.txt 2^>nul') do echo install %%i
	for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"C:\Windows\servicing\Packages\%%i" 1>nul 2>nul
	echo.
	echo.
	echo -----------------------------------------------install finish---------------------------------------------
	del /f /q List.txt
	pause > nul
)